//
// Created by wze-zero on 2024/7/14 014.
//
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int **arr = new int *[n];
    for (int i = 0; i < n; ++i) {
        arr[i] = new int[n];
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            *(*(arr + i) + j) = i + j;
            cout << *(*(arr + i) + j) << " ";
        }
        cout << endl;
    }
    return 0;
}
